package main.java.com.lee.thread;

import java.util.concurrent.locks.LockSupport;

/**
 * @Description TODO
 * @Author winston
 * @DateTime 2021/12/3
 */
public class ThreadStateDemo {
	public static void main(String[] args) throws InterruptedException {
		Thread thread = new Thread(){
			@Override
			public void run() {
				try {
					Thread.sleep(10000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
//				LockSupport.parkNanos(1000 * 1000 * 100);
			}
		};

		System.out.println("new Thread 之后的线程状态: " + thread.getState());
		thread.start();
		System.out.println("thread.start() 之后的线程状态: " + thread.getState());
//		LockSupport.parkNanos(1000 * 1000 * 10);
//		Thread.sleep(10000L);
//		System.out.println("LockSupport.park() 之后的线程状态: " + thread.getState());
//		thread.join();

		System.out.println("thread执行结束之后的线程状态: " + thread.getState());

	}



}
